using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Preparation;

namespace Tester.GuiActions.Actions.Impl
{
    public class SaveAsFileAction : BaseAction
    {
        public override bool Visible
        {
            get
            {
                return TesterMultyDocument.Instance != null &&
                      TesterMultyDocument.Instance.Suspended == TesterMultyDocument.SuspendStates.Stopped &&
                      TesterMainForm.Instance.TopControl == EmbededControlTags.TesterList;
            }
        }

        public override void MainAction(object sender, EventArgs e)
        {
            if (TesterMultyDocument.Instance != null)
            {
                if (TesterList.Instance!=null)
                {
                    TesterList.Instance.Save(true);
                    MessageBox.Show("Operation complete.", "Saved.");
                }
            }
        }

    }
}
